package com.daxue.eurekaclientuserservice.jarload.adaptor;

import com.fasterxml.jackson.databind.JsonNode;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Response;

/**
 * @author daxue0929
 * @date 2023/2/8
 */

public abstract class BaseIdentityAdaptor {

    public BaseIdentityAdaptor(){}


    public abstract Response authorize(JsonNode config, String state);

    /**
     * handle callback request and get user info
     *
     * @param config      identity config
     * @param httpRequest raw callback request
     * @return userinfo with unique id
     */
    public abstract Result handleCallbackAndGetUserModel(
        JsonNode config,
        HttpServletRequest httpRequest
    );

}
